// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

const ROUTE = {
  alarm: [],
  repair: [],
  repairApp: [],
  taskApp: [],
}

// 路由菜单树
CORE.ROUTE.MENU_TREE.forEach((major) => {
  // 二级路由菜单
  major.children.forEach((minor) => {
    if (minor.notice) {
      if (!ROUTE[minor.notice]) ROUTE[minor.notice] = []
      ROUTE[minor.notice].push([minor.id, minor.noticeScope])
    }

    // 三级路由菜单
    minor.children.forEach((leaf) => {
      if (leaf.notice) {
        if (!ROUTE[leaf.notice]) ROUTE[leaf.notice] = []
        ROUTE[leaf.notice].push([leaf.id, leaf.noticeScope])
      }
    })
  })
})

// ============================== 导出路由配置 ============================== //

export default ROUTE
